package com.atguigu.gmall.wms.mapper;

import com.atguigu.gmall.wms.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 *
 * @author xiezh
 * @email 3622533333@qq.com
 * @date 2021-03-12 18:35:49
 */
@Mapper
public interface WareSkuMapper extends BaseMapper<WareSkuEntity> {

    /**
     * 判断是否还有库存
     *
     * @param skuId
     * @param count
     * @return
     */
    public List<WareSkuEntity> check(@Param("skuId") Long skuId, @Param("count") Integer count);

    public Integer lock(@Param("id") Long id, @Param("count") Integer count);

}
